import 'package:flutter/material.dart';

///移动属性
class PreparePainter extends CustomPainter {
  late Paint _paint;

  @override
  void paint(Canvas canvas, Size size) {
    // TODO: implement paint
    print(size);
    _paint = Paint()
      ..color = Colors.blue
      ..style = PaintingStyle.fill;
    canvas.translate(size.width/2, size.height/2);
    canvas.drawCircle(Offset(0,0), 50, _paint);

    canvas.drawLine(
        Offset(0, 0),
        Offset(0, 50),
        _paint
          ..color = Colors.red
          ..strokeWidth = 5
          ..strokeCap = StrokeCap.butt
          ..style = PaintingStyle.stroke);
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) {
    // TODO: implement shouldRepaint
    return true;
  }
}
